<?php
ini_set('date.timezone', 'Europe/Moscow');
$path = realpath('../images/photos/thumbs/');

$handler = dir($path);

while (false !== ($file = $handler->read())) {
    if (in_array($file, array('.', '..'))) {
        continue;
    }
    
    rename($path . '/' . $file, $path . '/' . str_replace('thumb_', '', $file));
}

echo 'Done';